# Tuxlocator displaydeamon
# (c) 2007 by Rein Velt / http://geo.velt.org
# Published under the terms and conditions
# of the General Public License (GPL)
/bin/stty -F /dev/ttyS0 ospeed 19200

while true
do
export strUptime="`uptime`"
echo -n $strUptime | awk '{printf "%c%c%c%c|LOAD|",254,71,1,1}'                  > /dev/ttyS0
echo -n $strUptime | awk '{printf "%c%c%c%c|%1.2f|",254,71,1,2,$6}'              > /dev/ttyS0
echo -n $strUptime | awk '{printf "%c%c%c%c|%1.2f|",254,71,1,3,$7}'              > /dev/ttyS0
echo -n $strUptime | awk '{printf "%c%c%c%c|%1.2f|",254,71,1,4,$8}'              > /dev/ttyS0 

export strEth0="`ifconfig eth0 | grep inet |wc -l`"
export strPpp0="`ifconfig ppp0 | grep inet | wc -l`"
export strIp="`ifconfig eth0 | grep inet | awk '{print $2}'|sed 's/addr://g'`"
echo -n " " | awk '{ printf "%c%c%c%c*  CyberTux  *",254,71,7,1}' > /dev/ttyS0
echo -n " " | awk '{ printf "%c%c%c%c--------------",254,71,7,2}'              > /dev/ttyS0
echo -n $strEth0 $strPpp0 | awk '{ printf "%c%c%c%ceth0=%s|ppp0=%s|",254,71,7,3,$1,$2}'            > /dev/ttyS0
echo -n $strIp | awk '{ printf "%c%c%c%c%s",254,71,7,4,$0}'            > /dev/ttyS0


sleep 20
done
exit 0
